import request from '@/utils/request'
/**
 * 获取本部门的负责人
 * @returns
 */
export function getDepartments() {
  return request({
    url: 'company/department'
  })
}

/**
 * 获取部门详细数据
 * @returns
 */
export function getDepartmentsDetail(id) {
  return request({
    url: `company/department/${id}`
  })
}

/**
 * 编辑部门
 * @returns
 */
export function updateDepartment(data) {
  return request({
    url: `company/department/${data.id}`,
    method: 'put',
    data
  })
}

/**
 * 删除部门
 * @returns
 */
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

/**
 * 新增部门
 * @returns
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

